package com.mszlu.blog.service;

import com.mszlu.blog.vo.ArticleBodyVo;
import com.mszlu.blog.vo.ArticleVo;
import com.mszlu.blog.vo.Result;
import com.mszlu.blog.vo.params.ArticleParam;
import com.mszlu.blog.vo.params.PageParams;
import org.springframework.stereotype.Service;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

/**
 * Created with IntelliJ IDEA.
 *
 * @Author: 李
 * @Date: 2022/03/19/9:41
 * @Description:
 */

public interface ArticleService {

    /**
     * 文章搜索
     * @param search
     * @return
     */
    Result searchArticle(String search);
    /*
    * 分页查询文章列表
    * */
    //List<ArticleVo> listArticlesPage(PageParams pageParams);
    Result listArticle(PageParams pageParams);

    /**
     * 最热文章
     * @param limit
     * @return
     */
    Result hotArticle(int limit);
    /**
     * 最新文章
     * @param limit
     * @return
     */
    Result newArticles(int limit);
    /**
     * 文章归档
     * @return
     */
    Result listArchives();
    /**
     * 查看文章详情
     * @param articleId
     * @return
     */
    Result findArticleById(Long articleId, HttpServletRequest request);
    /**
     * 根据bodyId查询文章
     * @param bodyId
     * @return
     */
    ArticleBodyVo findArticleBodyById(Long bodyId);
    /**
     * 发布文章
     *
     * @return
     */
    Result publish(ArticleParam articleParam);

}
